// include/animal_factory.hpp
#pragma once
#include "animal.hpp"
#include <memory>

class AnimalFactory {
public:
  virtual ~AnimalFactory() = default;
  virtual std::unique_ptr<Animal> create() = 0;
  virtual const char *type_name() const = 0;
};

using AnimalFactoryPtr = std::unique_ptr<AnimalFactory>;

// 注册函数类型
extern "C" {
AnimalFactory *create_factory();
}